package com.testmanager.testmananger.user.service;

import com.testmanager.testmananger.user.domain.UserEntity;
import com.testmanager.testmananger.user.repository.UserRepository;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Data
@Service
@Slf4j
public class UserService {


    @Autowired
    UserRepository userRepository;

    public List<UserEntity> getAllUser(){

       List list=  userRepository.findAll();
       // log.info(list.toString());
       // System.out.println(list.toString());
        return list;
    }

    public UserEntity saveUser(UserEntity userEntity){

        UserEntity entity= userRepository.save(userEntity);
        entity.getJobType();
        return entity;
    }

}
